package cn.lavenliu.springboot.cruddemo;

import org.springframework.http.ResponseEntity;
import org.springframework.web.client.RestTemplate;

import cn.lavenliu.springboot.cruddemo.entity.Employee;

public class ClientDemo {
    public static void main(String[] args) {
        try {
            RestTemplate restTemplate = new RestTemplate();
            ResponseEntity<Employee> response = restTemplate.getForEntity("http://localhost:8080/api/employees/1", Employee.class);
            System.out.println(response.getBody());
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}